package com.xnyzc.lhy.mis.feign.fallback.didi;

import com.xnyzc.lhy.common.entity.DiDiRv;
import com.xnyzc.lhy.common.penum.EDiDiErrorCode;
import com.xnyzc.lhy.mis.entity.param.worksheet.didi.*;
import com.xnyzc.lhy.mis.feign.didi.CustomerServiceOperationService;
import com.xnyzc.lhy.mis.feign.didi.WorkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 服务的降级， 如出现远程调用失败，则会触发该回调
 *
 * @author haoyfa
 */
@Slf4j
@Service
public class WorkServiceFallback implements WorkService {
    @Override
    public DiDiRv getCreateWork(CreateWorkParam createWorkParam) {
        return DiDiRv.wrapError(EDiDiErrorCode.serverError);
        /**

        Map map = new HashMap<>();
        if(createWorkParam.getCustomer_type().equals(2)){
            map.put("司机phone","10000804777");
        }else{
            map.put("反馈放phone","10000804777");
        }
        return DiDiRv.wrap(EDiDiErrorCode.success,map);
*/
    }

    @Override
    public DiDiRv getUpdateWork(UpdateWorkParam updateWorkParam) {
        return DiDiRv.wrapError(EDiDiErrorCode.serverError);
    }

    @Override
    public DiDiRv getUnbundleNumber(UnbundleVirtualNumberParam param) {
        System.out.println("已经解绑了++++++++++++++++++++++++++++++++++++++");
        return  null;
    }

    @Override
    public DiDiRv getBindNumber(BindVirtualNumberParam virtualNumberParam) {
        Map map = new HashMap<>();
        map.put("phone","18910804777");
        map.put("bind_id","123456");
        return DiDiRv.wrap(EDiDiErrorCode.success,map);
    }

    @Override
    public DiDiRv getWorkUrgent(WorkUrgentParam workUrgentParam) {
        return null;
    }
}
